package com.itheima.service.omsService.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.domain.db.oms.OmsCompanyAddress;
import com.itheima.mapper.omsMapper.CompanyAddressMapper;
import com.itheima.service.omsService.CompanyAddressService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 收货地址
 *
 * @author DogeGuo
 */
@DubboService
public class CompanyAddressServiceImpl
        extends ServiceImpl<CompanyAddressMapper, OmsCompanyAddress>
        implements CompanyAddressService {

    @Autowired
    private CompanyAddressMapper companyAddressMapper;

    /**
     * 查询所有收货地址
     *
     * @return
     */
    @Override
    public List<OmsCompanyAddress> findAll() {
        LambdaQueryWrapper<OmsCompanyAddress> wrapper = new LambdaQueryWrapper();
        List<OmsCompanyAddress> list = companyAddressMapper.selectList(wrapper);
        return list;
    }

    /**
     * 根据id查询收货地址
     *
     * @param companyAddressId
     * @return
     */
    @Override
    public OmsCompanyAddress findById(Long companyAddressId) {
        return companyAddressMapper.selectById(companyAddressId);
    }
}
